<%@ Page Language="C#" AutoEventWireup="true" CodeFile="office_acl_X.aspx.cs" Inherits="office_acl" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <asp:Label ID="Label2" runat="server" Text="Office Type:"></asp:Label>
        <asp:DropDownList ID="lstOfficeTypes" runat="server">
            <asp:ListItem>COR</asp:ListItem>
            <asp:ListItem>FAR</asp:ListItem>
            <asp:ListItem Value="NET"></asp:ListItem>
            <asp:ListItem Value="INV"></asp:ListItem>
            <asp:ListItem Value="DEP"></asp:ListItem>
            <asp:ListItem Value="SAL"></asp:ListItem>
            <asp:ListItem Value="AGT"></asp:ListItem>
            <asp:ListItem Value="B2C"></asp:ListItem>
            <asp:ListItem Value="CRS"></asp:ListItem>
        </asp:DropDownList><br />


                <asp:Label ID="Label1" runat="server" Text="Avail. Funcions:"></asp:Label>
                <asp:DropDownList ID="lstAvailFunc" runat="server" DataSourceID="sqlAvailFunc" DataTextField="func_name" DataValueField="func_id">
                </asp:DropDownList>
        <asp:Button ID="btnAdd" runat="server" Text=" Add " OnClick="btnAdd_Click" />&nbsp;
        <asp:SqlDataSource ID="sqlGetOfficeTypes" runat="server"></asp:SqlDataSource>
                <br />
                <asp:Label ID="lblError" runat="server" CssClass="message"></asp:Label><br />
                &nbsp;<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">
            <Columns>
                <asp:TemplateField>
                            <ItemTemplate>
                                <input name="KEY" type="radio" value='<%#  Eval("office_type")+"|"+Eval("func_id") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                <asp:BoundField DataField="office_type" HeaderText="office_type" SortExpression="office_type" />
                <asp:BoundField DataField="func_id" HeaderText="func_id" SortExpression="func_id" />
                <asp:BoundField DataField="name" HeaderText="name" SortExpression="name" />
            </Columns>
        </asp:GridView>
                <asp:Button ID="btnRefresh" runat="server" Text="Refresh" OnClick="btnRefresh_Click" />
                <asp:Button ID="btnRemove" runat="server" Text="Remove" OnClick="btnRemove_Click" />
                <asp:HiddenField ID="hidOffice" runat="server" />
                <br />
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
                    SelectCommand="sp_get_office_acl_by_office_type" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="lstOfficeTypes" Name="office_type" PropertyName="SelectedValue" Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
                <asp:SqlDataSource ID="sqlAvailFunc" runat="server" ConnectionString="<%$ ConnectionStrings:SparrowDB %>"
                    SelectCommand="sp_get_avail_office_acl_by_office_type" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="lstOfficeTypes" Name="office_type" PropertyName="SelectedValue"
                            Type="String" />
                    </SelectParameters>
                </asp:SqlDataSource>
        &nbsp; &nbsp;&nbsp; &nbsp;<br />
        &nbsp; &nbsp; &nbsp;<br />
        &nbsp;
        <footerstyle backcolor="#507CD1" font-bold="True" forecolor="White" />
        <rowstyle backcolor="#EFF3FB" />
        <asp:BoundField DataField="func_id" HeaderText="func_id" ReadOnly="True" SortExpression="func_id" /><asp:BoundField DataField="name" HeaderText="name" SortExpression="name" /><pagerstyle backcolor="#2461BF" forecolor="White" horizontalalign="Center" /><selectedrowstyle backcolor="#D1DDF1" font-bold="True" forecolor="#333333" /><headerstyle backcolor="#507CD1" font-bold="True" forecolor="White" /><editrowstyle backcolor="#2461BF" /><alternatingrowstyle backcolor="White" />&nbsp;
        <asp:ControlParameter ControlID="lstOfficeTypes" Name="office_type" PropertyName="SelectedValue"
            Type="String" />
        &nbsp;&nbsp; &nbsp;
        <br />
        &nbsp; &nbsp;<br />
        <br />
        <br />
        <br />
    
    </div>
    </form>
</body>
</html>
